class LoginEntity {
  String accessToken;
  String refreshToken;
  String loginId;
  String scope;
  String tokenType;
  int expiresIn;
  String jti;
  Operator operator;
  Customer customer;
  LoginEntity(
      {this.accessToken,
        this.refreshToken,
        this.loginId,
        this.scope,
        this.tokenType,
        this.expiresIn,
        this.jti,
        this.operator,
        this.customer});

  LoginEntity.fromJson(Map<String, dynamic> json) {
    accessToken = json['access_token'];
    refreshToken = json['refresh_token'];
    loginId = json['loginId'];
    scope = json['scope'];
    tokenType = json['token_type'];
    expiresIn = json['expires_in'];
    jti = json['jti'];
    operator = json['operator'] != null
        ? new Operator.fromJson(json['operator'])
        : null;
    customer = json['customer'] != null
        ? new Customer.fromJson(json['customer'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['access_token'] = this.accessToken;
    data['refresh_token'] = this.refreshToken;
    data['loginId'] = this.loginId;
    data['scope'] = this.scope;
    data['token_type'] = this.tokenType;
    data['expires_in'] = this.expiresIn;
    data['jti'] = this.jti;
    if (this.operator != null) {
      data['operator'] = this.operator.toJson();
    }
    if (this.customer != null) {
      data['customer'] = this.customer.toJson();
    }
    return data;
  }
}

class Operator {
  String oid;
  String name;
  String loginId;
  String idNo;
  String mobile;
  String department;
  String market;
  String marketId;
  String marketName;
  int version;

  Operator(
      {this.oid,
        this.name,
        this.loginId,
        this.idNo,
        this.mobile,
        this.department,
        this.market,
        this.marketId,
        this.marketName,
        this.version});

  Operator.fromJson(Map<String, dynamic> json) {
    oid = json['oid'];
    name = json['name'];
    loginId = json['loginId'];
    idNo = json['idNo'];
    mobile = json['mobile'];
    department = json['department'];
    market = json['market'];
    marketId = json['marketId'];
    marketName = json['marketName'];
    version = json['version'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['oid'] = this.oid;
    data['name'] = this.name;
    data['loginId'] = this.loginId;
    data['idNo'] = this.idNo;
    data['mobile'] = this.mobile;
    data['department'] = this.department;
    data['market'] = this.market;
    data['marketId'] = this.marketId;
    data['marketName'] = this.marketName;
    data['version'] = this.version;
    return data;
  }
}

class Customer {
  String customer;
  String customerId;
  String customerName;

  Customer(
      {this.customer,
        this.customerId,
        this.customerName
       });

  Customer.fromJson(Map<String, dynamic> json) {
    customer = json['customer'];
    customerId = json['customerId'];
    customerName = json['customerName'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['customer'] = this.customer;
    data['customerId'] = this.customerId;
    data['customerName'] = this.customerName;
    return data;
  }
}